package com.shop.service.impl;

import com.shop.dao.OperLogDao;
import com.shop.entity.OperLog;
import com.shop.service.OperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class OperLogServiceImpl implements OperLogService {
    @Autowired
    private OperLogDao operLogDao;

    @Override
    public OperLog findById(int id) {
        return operLogDao.getOne(id);
    }

    @Override
    public Page<OperLog> findAll(Pageable pageable) {
        return operLogDao.findAll(pageable);
    }

    @Override
    public List<OperLog> findAllExample(Example<OperLog> example) {
        return operLogDao.findAll(example);
    }

    @Override
    public void update(OperLog operLog) {
        operLogDao.save(operLog);
    }

    @Override
    public void create(OperLog operLog) {
        operLogDao.save(operLog);
    }

    @Override
    public void delById(int id) {
        operLogDao.delete(id);
    }


}
